Integrand size = 20, antiderivative size = 97 \[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\frac {4 i d (c+d x) \arctan \left (e^{i (a+b x)}\right )}{b^2}-\frac {2 i d^2 \operatorname {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \operatorname {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \sec (a+b x)}{b} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4494, 4266, 2317, 2438} \[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\frac {4 i d (c+d x) \arctan \left (e^{i (a+b x)}\right )}{b^2}-\frac {2 i d^2 \operatorname {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \operatorname {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \sec (a+b x)}{b} \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 4266
Rule 4494
Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {(2 d) \int (c+d x) \sec (a+b x) \, dx}{b} \\ & = \frac {4 i d (c+d x) \arctan \left (e^{i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \sec (a+b x)}{b}+\frac {\left (2 d^2\right ) \int \log \left (1-i e^{i (a+b x)}\right ) \, dx}{b^2}-\frac {\left (2 d^2\right ) \int \log \left (1+i e^{i (a+b x)}\right ) \, dx}{b^2} \\ & = \frac {4 i d (c+d x) \arctan \left (e^{i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {\left (2 i d^2\right ) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}+\frac {\left (2 i d^2\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3} \\ & = \frac {4 i d (c+d x) \arctan \left (e^{i (a+b x)}\right )}{b^2}-\frac {2 i d^2 \operatorname {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \operatorname {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \sec (a+b x)}{b} \\ \end{align*}
Time = 1.84 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.79 \[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\frac {-4 b c d \text {arctanh}\left (\sin (a)+\cos (a) \tan \left (\frac {b x}{2}\right )\right )-4 d^2 \arctan (\cot (a)) \text {arctanh}\left (\sin (a)+\cos (a) \tan \left (\frac {b x}{2}\right )\right )+\frac {2 d^2 \csc (a) \left ((b x-\arctan (\cot (a))) \left (\log \left (1-e^{i (b x-\arctan (\cot (a)))}\right )-\log \left (1+e^{i (b x-\arctan (\cot (a)))}\right )\right )+i \operatorname {PolyLog}\left (2,-e^{i (b x-\arctan (\cot (a)))}\right )-i \operatorname {PolyLog}\left (2,e^{i (b x-\arctan (\cot (a)))}\right )\right )}{\sqrt {\csc ^2(a)}}+b^2 (c+d x)^2 \sec (a+b x)}{b^3} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (86 ) = 172\).
Time = 1.23 (sec) , antiderivative size = 227, normalized size of antiderivative = 2.34
method | result | size |
risch | \(\frac {2 \,{\mathrm e}^{i \left (x b +a \right )} \left (x^{2} d^{2}+2 c d x +c^{2}\right )}{b \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}+\frac {4 i d c \arctan \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{3}}-\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}-\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{3}}-\frac {2 i d^{2} \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {2 i d^{2} \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}-\frac {4 i d^{2} a \arctan \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}\) | \(227\) |
derivativedivides | \(\frac {\frac {a^{2} d^{2}}{b^{2} \cos \left (x b +a \right )}-\frac {2 a c d}{b \cos \left (x b +a \right )}-\frac {2 a \,d^{2} \left (\frac {x b +a}{\cos \left (x b +a \right )}-\ln \left (\sec \left (x b +a \right )+\tan \left (x b +a \right )\right )\right )}{b^{2}}+\frac {c^{2}}{\cos \left (x b +a \right )}+\frac {2 c d \left (\frac {x b +a}{\cos \left (x b +a \right )}-\ln \left (\sec \left (x b +a \right )+\tan \left (x b +a \right )\right )\right )}{b}+\frac {d^{2} \left (\frac {\left (x b +a \right )^{2}}{\cos \left (x b +a \right )}+2 \left (x b +a \right ) \ln \left (1+i {\mathrm e}^{i \left (x b +a \right )}\right )-2 \left (x b +a \right ) \ln \left (1-i {\mathrm e}^{i \left (x b +a \right )}\right )-2 i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (x b +a \right )}\right )+2 i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (x b +a \right )}\right )\right )}{b^{2}}}{b}\) | \(234\) |
default | \(\frac {\frac {a^{2} d^{2}}{b^{2} \cos \left (x b +a \right )}-\frac {2 a c d}{b \cos \left (x b +a \right )}-\frac {2 a \,d^{2} \left (\frac {x b +a}{\cos \left (x b +a \right )}-\ln \left (\sec \left (x b +a \right )+\tan \left (x b +a \right )\right )\right )}{b^{2}}+\frac {c^{2}}{\cos \left (x b +a \right )}+\frac {2 c d \left (\frac {x b +a}{\cos \left (x b +a \right )}-\ln \left (\sec \left (x b +a \right )+\tan \left (x b +a \right )\right )\right )}{b}+\frac {d^{2} \left (\frac {\left (x b +a \right )^{2}}{\cos \left (x b +a \right )}+2 \left (x b +a \right ) \ln \left (1+i {\mathrm e}^{i \left (x b +a \right )}\right )-2 \left (x b +a \right ) \ln \left (1-i {\mathrm e}^{i \left (x b +a \right )}\right )-2 i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (x b +a \right )}\right )+2 i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (x b +a \right )}\right )\right )}{b^{2}}}{b}\) | \(234\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 446 vs. \(2 (79) = 158\).
Time = 0.29 (sec) , antiderivative size = 446, normalized size of antiderivative = 4.60 \[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right )}{b^{3} \cos \left (b x + a\right )} \]
[In]
[Out]
\[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\int \left (c + d x\right )^{2} \tan {\left (a + b x \right )} \sec {\left (a + b x \right )}\, dx \]
[In]
[Out]
\[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \sec \left (b x + a\right ) \tan \left (b x + a\right ) \,d x } \]
[In]
[Out]
\[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \sec \left (b x + a\right ) \tan \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx=\int \frac {\mathrm {tan}\left (a+b\,x\right )\,{\left (c+d\,x\right )}^2}{\cos \left (a+b\,x\right )} \,d x \]
[In]
[Out]